package com.example.lgseckill.controller;

import com.example.lgseckill.domain.SysUser;
import com.example.lgseckill.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author:e
 * Date:2021/8/16 5:23 下午
 **/
@RestController
@RequestMapping("/user")
public class SysUserController {


    @Autowired
    private ISysUserService sysUserService;

    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    @GetMapping()
    public List<SysUser> getList(){
        return sysUserService.list();
    }

    @GetMapping("info")
    public String getUserInfo(){
        String myKey = redisTemplate.opsForValue().get("key");
        return myKey;
    }

}
